<?php

class My_Acl extends Zend_Acl{
          public function __construct(){
                 $this->addRole(new Zend_Acl_Role('gosc'));
                 $this->addRole(new Zend_Acl_Role('zwykly'), 'gosc');
                 $this->addRole(new Zend_Acl_Role('premium'), 'zwykly');
                 $this->addRole(new Zend_Acl_Role('admin'));
 
                 $this->add(new Zend_Acl_Resource('zalogowani'));
                 $this->add(new Zend_Acl_Resource('index'));
                 $this->add(new Zend_Acl_Resource('error'));
 
                 $this->allow('gosc', 'index', null);

                 $this->allow('gosc', 'zalogowani', array('filmysd', 'filmyhd', 'seriale','filmy', 'wyszukiwanie', 'junior'));

                 $this->allow('gosc', 'error', null);
                 $this->allow('zwykly', 'zalogowani', array('index', 'zwykly', 'profilkonta','edytujkonto',
                     'poedycjikonta', 'filmysd','filmyhdfree','seriale', 'ogladajsd', 'ogladajserial','junior','ogladajjunior', 'wyszukiwanie','listaulubionych'));
                 $this->allow('premium', 'zalogowani', array('index', 'zwykly', 'profilkonta','edytujkonto',
                     'poedycjikonta', 'filmysd','filmyhd','seriale', 'ogladajsd', 'ogladajhd', 'ogladajserial','junior','ogladajjunior', 'wyszukiwanie','listaulubionych'));
                 $this->allow('admin', null, null);
         }
 }
 
